﻿using System;
using System.Activities;
using System.Activities.Tracking;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AuditSample.Activities
{
    public class SaveStateActivity : CodeActivity
    {
        public InArgument<string> AuditRole { get; set; }

        public InArgument<string> Auditer { get; set; }

        public InArgument<string> State { get; set; }

        protected override void Execute(CodeActivityContext context)
        {
            var customRecord = new CustomTrackingRecord("StateTracking");
            customRecord.Data.Add("AuditRole", AuditRole.Get(context));
            customRecord.Data.Add("Auditer", Auditer.Get(context));
            customRecord.Data.Add("State", State.Get(context));
            customRecord.Data.Add("Date", DateTime.Now);
            context.Track(customRecord);
        }
    }
}
